package mall.pojo;
// default package
// Generated 02-Nov-2013 21:11:38 by Hibernate Tools 3.4.0.CR1

import java.util.Date;
import java.util.HashSet;
import java.util.Set;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.GeneratedValue;
import static javax.persistence.GenerationType.IDENTITY;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.OneToMany;
import javax.persistence.Table;
import javax.persistence.Temporal;
import javax.persistence.TemporalType;

/**
 * Member generated by hbm2java
 */
@Entity
@Table(name = "member", catalog = "mall")
public class Member implements java.io.Serializable {

	private Integer id;
	private Membertype membertype;
	private Memberposition memberposition;
	private Date date;
	private String email;
	private String fullname;
	private String password;
	private String username;
	private Set<Orders> orderses = new HashSet<Orders>(0);
	private Set<Shop> shops = new HashSet<Shop>(0);
	

	public Member() {
	}

	public Member(Membertype membertype, Memberposition memberposition,
			Date date, String email, String fullname, String password,
			String username) {
		this.membertype = membertype;
		this.memberposition = memberposition;
		this.date = date;
		this.email = email;
		this.fullname = fullname;
		this.password = password;
		this.username = username;
	}

	public Member(Membertype membertype, Memberposition memberposition,
			Date date, String email, String fullname, String password,
			String username, Set<Orders> orderses, Set<Shop> shops) {
		this.membertype = membertype;
		this.memberposition = memberposition;
		this.date = date;
		this.email = email;
		this.fullname = fullname;
		this.password = password;
		this.username = username;
		this.orderses = orderses;
		this.shops = shops;
	}

	@Id
	@GeneratedValue(strategy = IDENTITY)
	@Column(name = "id", unique = true, nullable = false)
	public Integer getId() {
		return this.id;
	}

	public void setId(Integer id) {
		this.id = id;
	}

	@ManyToOne(fetch = FetchType.LAZY)
	@JoinColumn(name = "membertype_id", nullable = false)
	public Membertype getMembertype() {
		return this.membertype;
	}

	public void setMembertype(Membertype membertype) {
		this.membertype = membertype;
	}

	@ManyToOne(fetch = FetchType.EAGER)
	@JoinColumn(name = "memberposition_id", nullable = false)
	public Memberposition getMemberposition() {
		return this.memberposition;
	}

	public void setMemberposition(Memberposition memberposition) {
		this.memberposition = memberposition;
	}

	@Temporal(TemporalType.TIMESTAMP)
	@Column(name = "date", nullable = false, length = 19)
	public Date getDate() {
		return this.date;
	}

	public void setDate(Date date) {
		this.date = date;
	}

	@Column(name = "email", nullable = false, length = 45)
	public String getEmail() {
		return this.email;
	}

	public void setEmail(String email) {
		this.email = email;
	}

	@Column(name = "fullname", nullable = false, length = 45)
	public String getFullname() {
		return this.fullname;
	}

	public void setFullname(String fullname) {
		this.fullname = fullname;
	}

	@Column(name = "password", nullable = false)
	public String getPassword() {
		return this.password;
	}

	public void setPassword(String password) {
		this.password = password;
	}

	@Column(name = "username", nullable = false, length = 45)
	public String getUsername() {
		return this.username;
	}

	public void setUsername(String username) {
		this.username = username;
	}

	@OneToMany(fetch = FetchType.LAZY, mappedBy = "member")
	public Set<Orders> getOrderses() {
		return this.orderses;
	}

	public void setOrderses(Set<Orders> orderses) {
		this.orderses = orderses;
	}

	@OneToMany(fetch = FetchType.EAGER, mappedBy = "member")
	public Set<Shop> getShops() {
		return this.shops;
	}

	public void setShops(Set<Shop> shops) {
		this.shops = shops;
	}

}
